package com.ccc.controller;

import com.ccc.bean.BaseRespVo;
import com.ccc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @description:
 * @autyor:caicaicai
 */
@Controller
@ResponseBody
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("user/name/{id}")
    public BaseRespVo queryUserName(@PathVariable("id")Integer id){
        String s = userService.queryUserName(id);
        return BaseRespVo.ok(s);
    }

    @RequestMapping("user/age/{id}")
    public BaseRespVo queryUserAge(@PathVariable("id")Integer id){
        System.out.println("queryUserAge()");
        return BaseRespVo.ok();
    }

}
